<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>test</title>
</head>
<body>

</body>
<script type="text/javascript">

    function doTheThing() {
        console.log(definedLater);
        var definedLater;//要先定义才能输出
        definedLater = 'I am defined!'
        console.log(definedLater)

        console.log(definedSimulateneously);
        var definedSimulateneously = 'I am defined!'

        console.log(definedSimulateneously)

        doSomethingElse();//可以输出，下面是个方法
        function doSomethingElse(){
            console.log('I did it!');
        }


        functionVar();//输出不了，对象没定义

        var functionVar = function(){
            console.log('I did it!');
        }
    }
    doTheThing();
</script>
</html>